-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Avoid a bitcast FFI call in transmuting #142768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
For things that only change the valid ranges, we can just skip the `LLVMBuildBitCast` call. I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
rustbot has assigned @WaffleLapkin. Use |
Some changes occurred in compiler/rustc_codegen_ssa |
@bors r+ rollup |
did not mean to clone PR... |
…=WaffleLapkin Avoid a bitcast FFI call in transmuting For things that only change the valid ranges, we can just return the input, rather than making the `LLVMBuildBitCast` call and having *it* then do nothing. I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
Rollup of 15 pull requests Successful merges: - #135731 (Implement parsing of pinned borrows) - #138780 (Add `#[loop_match]` for improved DFA codegen) - #142453 (Windows: make `read_dir` stop iterating after the first error is encountered) - #142633 (Error on invalid signatures for interrupt ABIs) - #142768 (Avoid a bitcast FFI call in transmuting) - #142825 (Port `#[track_caller]` to the new attribute system) - #142844 (Enable short-ice for Windows) - #142934 (Tweak `-Zmacro-stats` measurement.) - #142955 (Couple of test suite fixes for cg_clif) - #142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠) - #142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect) - #142982 (Corrected spelling mistake in c_str.rs) - #142983 (Taint body on invalid call ABI) - #142988 (Update wasm-component-ld to 0.5.14) - #142993 (Update cargo) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142768 - scottmcm:avoid-unneeded-bitcast, r=WaffleLapkin Avoid a bitcast FFI call in transmuting For things that only change the valid ranges, we can just return the input, rather than making the `LLVMBuildBitCast` call and having *it* then do nothing. I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
Huh, I wasn't expecting anything material from this, but something in #142997 was, so out of curiosity |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (4e95f4a): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.3%, secondary -1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -5.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 689.044s -> 689.011s (-0.00%) |
Rollup of 15 pull requests Successful merges: - rust-lang/rust#135731 (Implement parsing of pinned borrows) - rust-lang/rust#138780 (Add `#[loop_match]` for improved DFA codegen) - rust-lang/rust#142453 (Windows: make `read_dir` stop iterating after the first error is encountered) - rust-lang/rust#142633 (Error on invalid signatures for interrupt ABIs) - rust-lang/rust#142768 (Avoid a bitcast FFI call in transmuting) - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system) - rust-lang/rust#142844 (Enable short-ice for Windows) - rust-lang/rust#142934 (Tweak `-Zmacro-stats` measurement.) - rust-lang/rust#142955 (Couple of test suite fixes for cg_clif) - rust-lang/rust#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠) - rust-lang/rust#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect) - rust-lang/rust#142982 (Corrected spelling mistake in c_str.rs) - rust-lang/rust#142983 (Taint body on invalid call ABI) - rust-lang/rust#142988 (Update wasm-component-ld to 0.5.14) - rust-lang/rust#142993 (Update cargo) r? `@ghost` `@rustbot` modify labels: rollup
Idk how, but this is creating miscompilations when casting from Which brings up the question, are these transmutes even valid? Because they are used quite a bit in stdarch (mainly in ARM, which has 1-element SIMD types) |
For things that only change the valid ranges, we can just return the input, rather than making the
LLVMBuildBitCast
call and having it then do nothing.I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.